home *** CD-ROM | disk | FTP | other *** search
- #include "testlib.h"
-
- pascal char declthenuse_return_1st_plus1(char ch, short sh, long lo);
- pascal short declthenuse_return_2nd_plus1(char ch, short sh, long lo);
- pascal long declthenuse_return_3rd_plus1(char ch, short sh, long lo);
-
- pascal char xxxthenuse_return_1st_plus1(char ch, short sh, long lo);
-
- pascal char xxxthenuse_return_1st_plus1(char ch, short sh, long lo)
- {
- return ch + 1;
- }
-
- pascal char defthenuse_return_1st_plus1(char ch, short sh, long lo)
- {
- return ch + 1;
- }
-
- pascal short defthenuse_return_2nd_plus1(char ch, short sh, long lo)
- {
- return sh + 1;
- }
-
- pascal long defthenuse_return_3rd_plus1(char ch, short sh, long lo)
- {
- return lo + 1;
- }
-
- pascal int glob = 999;
-
- typedef pascal int PasVarType;
-
- PasVarType glob2 = 444;
-
- test_pascal()
- {
- Debugger();
- // itesteq(__LINE__, 'b', defthenuse_return_1st_plus1('a', 12345, 123456789));
- // itesteq(__LINE__, 12346, defthenuse_return_2nd_plus1('a', 12345, 123456789));
- // itesteq(__LINE__, 987654322, defthenuse_return_3rd_plus1('a', 12345, 987654321));
- itesteq(__LINE__, 'b', declthenuse_return_1st_plus1('a', 12345, 123456789));
- itesteq(__LINE__, 12346, declthenuse_return_2nd_plus1('a', 12345, 123456789));
- itesteq(__LINE__, 987654322, declthenuse_return_3rd_plus1('a', 12345, 987654321));
- itesteq(__LINE__, 999, glob);
- itesteq(__LINE__, 444, glob2);
- }
-
- pascal char declthenuse_return_1st_plus1(char ch, short sh, long lo)
- {
- return ch + 1;
- }
-
- pascal short declthenuse_return_2nd_plus1(char ch, short sh, long lo)
- {
- return sh + 1;
- }
-
- pascal long declthenuse_return_3rd_plus1(char ch, short sh, long lo)
- {
- return lo + 1;
- }
-
- pascal short bar(char, short, long);
- pascal short (*tobar)(char, short, long);
-
- typedef pascal short (*barptr)(char, short, long);
-
- barptr tobar2;
- pascal barptr tobar3;
-
- short fancy(barptr callback, short ditem);
-
- test_pascal_2()
- {
- foo(1, 2, 3);
- bar(4, 5, 6);
- (*tobar)(7, 8, 9);
- (*tobar2)(10, 11, 12);
- (*tobar3)(13, 14, 15);
- fancy(tobar2, 12345);
- }
-
- short fancy(barptr callback, short ditem)
- {
- return (*callback)(1, ditem, 3);
- }
-
-
- int
- main()
- {
- curtestfile = __FILE__;
-
- test_pascal();
-
- summary();
-
- return 0;
- }
-